You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR allows SM to support the nightly label to manage Grid SNAPSHOTS, as requested in #13384. For example:
./selenium-manager --debug --grid nightly
[2025-03-03T15:28:16.874Z DEBUG] grid not found in the system
[2025-03-03T15:28:17.036Z DEBUG] Required driver: selenium-server 4.30.0-SNAPSHOT
[2025-03-03T15:28:17.037Z DEBUG] Acquiring lock: C:\Users\boni\.cache\selenium\grid\4.30.0-SNAPSHOT\sm.lock
[2025-03-03T15:28:17.037Z DEBUG] Downloading selenium-server 4.30.0-SNAPSHOT from https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.30.0-SNAPSHOT.jar
[2025-03-03T15:28:21.533Z INFO ] Driver path: C:\Users\boni\.cache\selenium\grid\4.30.0-SNAPSHOT\selenium-server-4.30.0-SNAPSHOT.jar
./selenium-manager --debug --grid
[2025-03-03T15:28:26.188Z DEBUG] grid not found in the system
[2025-03-03T15:28:26.230Z DEBUG] Required driver: selenium-server 4.29.0
[2025-03-03T15:28:26.232Z DEBUG] Acquiring lock: C:\Users\boni\.cache\selenium\grid\4.29.0\sm.lock
[2025-03-03T15:28:26.232Z DEBUG] Downloading selenium-server 4.29.0 from https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.29.0/selenium-server-4.29.0.jar
[2025-03-03T15:28:30.690Z INFO ] Driver path: C:\Users\boni\.cache\selenium\grid\4.29.0\selenium-server-4.29.0.jar
./selenium-manager --debug --grid 4.28.0
[2025-03-03T15:28:34.507Z DEBUG] grid not found in the system
[2025-03-03T15:28:34.508Z DEBUG] Acquiring lock: C:\Users\boni\.cache\selenium\grid\4.28.0\sm.lock
[2025-03-03T15:28:34.508Z DEBUG] Downloading selenium-server 4.28.0 from https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.28.0/selenium-server-4.28.0.jar
[2025-03-03T15:28:39.088Z INFO ] Driver path: C:\Users\boni\.cache\selenium\grid\4.28.0\selenium-server-4.28.0.jar
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
Why: The suggestion addresses a critical safety issue by preventing potential runtime panics when GRID_RELEASE is not found in the URL. Using unwrap() without error handling could crash the application in production.
High
Handle potential None in extension parsing
Add error handling for the case when rfind(GRID_EXTENSION) returns None to prevent unwrap panic in nightly version parsing.
let driver_version = if is_nightly {
- let index_jar = driver_url.rfind(GRID_EXTENSION).unwrap() - 1;+ let index_jar = driver_url+ .rfind(GRID_EXTENSION)+ .ok_or_else(|| Error::WebDriverError(format!("Invalid Grid extension format: {}", driver_url)))?+ - 1;
driver_url.as_str()[index_release..index_jar].to_string()
} else {
Apply this suggestion
Suggestion importance[1-10]: 9
__
Why: This suggestion fixes a potential runtime panic by properly handling the case where GRID_EXTENSION is not found in the URL, especially critical for nightly version parsing.
High
Add string bounds validation
Add bounds checking before string slicing to prevent potential panic if indices are out of range.
+if index_release >= driver_url.len() || index_jar > driver_url.len() || index_release > index_jar {+ return Err(Error::WebDriverError(format!("Invalid version string indices in URL: {}", driver_url)));+}
driver_url.as_str()[index_release..index_jar].to_string()
Apply this suggestion
Suggestion importance[1-10]: 8
__
Why: The suggestion prevents potential index out of bounds panics during string slicing, which is a critical safety improvement for handling malformed URLs.
The action failed due to test failures in the integration_output_tests suite:
3 tests failed consistently across multiple runs: json_output_test, shell_output_test, and mixed_output_test
The root cause appears to be that the ChromeDriver was unavailable at the expected path: C:\Users\runneradmin.cache\selenium\chromedriver\win64\133.0.6943.141\chromedriver.exe
The json_output_test failed with assertion driver.exists(), indicating the driver file was not found
The tests returned error code 69 with message "Driver unavailable"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Motivation and Context
This PR allows SM to support the
nightlylabel to manage Grid SNAPSHOTS, as requested in #13384. For example:Types of changes
Checklist
PR Type
Enhancement, Bug fix
Description
Added support for
nightlylabel in Selenium Manager to manage Grid SNAPSHOTS.Updated logic to handle nightly and non-nightly driver versions.
Enhanced metadata handling for nightly driver versions.
Improved version parsing and validation for Grid releases.
Changes walkthrough 📝
grid.rs
Implement nightly Grid support in Selenium Managerrust/src/grid.rs
versions.
lib.rs
Update driver version discovery for nightly Gridrust/src/lib.rs